﻿using EnvirProtection.App_Start;
using IService;
using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Security.Claims;
using System.Threading.Tasks;
using System.Web.Http;
using webapi.Common;

namespace EnvirProtection.Controllers
{
    [RoutePrefix("Default")]
    public class DefaultController : ApiController
    {  
        public IUserService userService { get; set; }

        private static ILog log = LogManager.GetLogger(typeof(DefaultController));
        [Route("CheckLogin"), HttpGet]
        public async Task<bool> CheckLogin(string name,string password)
        {
            log.InfoFormat(name+DateTime.Now.ToString());
            
            return await userService.CheckLoginAsync(name, password);
           
        }
    }
}
